Performance of central processing units (hereinafter, CPU) to be used in embedded devices (for example, mobile telephones) is improved, and thus a plurality of operating systems (hereinafter, OS) can be operated by means of virtualization on same CPU. In such devices, not CPUs with virtualization supports such as CPUs for personal computers or servers but CPUs specialized for embedding are used. That is to say, in the embedded devices, the performance can be virtualized but the virtualization of the functions needs the virtualization supports by software.
When OSs are not in the virtualized environment, a control for eliminating TLB (Translation Lookaside Buffer) flush is made. If each virtualized OS (guest OS) performs no operations in TLB flush at the time of virtualization, this control does not function effectively in switching between the guest OSs. As a result, TLB flush increases more than the case where the OSs are not virtualized.
For example, a global region of a virtual memory to be used as an OS kernel region might be normally present in the same virtual address in each guest OS. Due to ASID (Address Space Identifier) that enables a memory map of each process to be cached as a TLB entry, the TLB flush is not necessary for switching between the processes in the guests. In the switching between the guests, however, when ASID is overlapped, the TLB flush is necessary.
Since the ASIDs are used in relation to process IDs, the ASIDs are used sequentially from 0 in OSs, and thus they are highly likely overlapped between the guests. Further, due to domains where memory regions are classified and an access can be protected, kernel regions and user regions are separated so that the access control is made based on the domains in each OS.
When a domain is overlapped, and if the region of the domain is global, or the region is local and ASID is identical, the TLB flush is necessary for the switching between the guests. Particularly the global regions mostly have the same domain.
It is considered that the control is changed on the assumption that a plurality of guest OSs is present. For example when a maximum number of ASIDs treated by the guest is limited, a number of processes treated by the OSs is limited, thereby influencing a design of OSs. That is to say, it seems to be very difficult to suitably change the control of guest OSs.
In order that a use method of ASID in guest OS is not changed, Japanese Laid-open Patent Publication No. 2009-151650, Japanese Patent No. 2825550, and Japanese Laid-open Patent Publication No. 05-035597 discuss the following methods. In these methods, a correspondence table between ASIDs to be used by guest OSs and actual ASIDs is prepared, and a control is made so that the guest OS freely use the ASID but the actual ASID is not overlapped.
However, in the conventional techniques, it is difficult for the TLB flush in global regions to be reduced.
In the conventional techniques, TLB entry is managed so that actually used ASIDs are accurately recognized and free ASIDs are collected, so the ASIDs are prevented from being used in an overlapped manner. However, since the management of the TLB entry is a process with very heavy load, the reduction in the TLB flush becomes less important. That is to say, since it is difficult for the TLB entry to be managed in an actual environment, it is difficult for free ASIDs to be collected, and thus the ASIDs may be used in an overlapped manner. It appears to be a reality that it is difficult for the conventional technique to cope with such a circumstance.